# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=php7-gearman
_pkgreal=gearman
_prefix=pecl-gearman
pkgver=2.0.6
_pkgver=${pkgver/_rc/RC}
pkgrel=2
pkgdesc="PHP7 wrapper to libgearman"
url="https://github.com/wcgallego/pecl-gearman"
arch="all"
license="PHP-3.01"
options="!check" # Requires server running
depends="php7-pcntl"
makedepends="gearman-dev php7-dev"
source="https://github.com/wcgallego/$_prefix/archive/$_pkgreal-$_pkgver.zip"
builddir="$srcdir/$_prefix-$_pkgreal-$_pkgver"

build() {
	phpize7
	./configure \
		--prefix=/usr \
		--with-php-config=/usr/bin/php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > \
		"$pkgdir"/etc/php7/conf.d/$_pkgreal.ini
}

sha512sums="5c159f766bd8674d387760bbd90ec9de0e54a677917f56e148db8b15c83c7d81ce0f1c2be68120e70fe4b5b70f502d0562f6038934e03997b3f480227ea30762  gearman-2.0.6.zip"
